<?php
$dbh=new PDO('mysql:host=localhost;dbname=gaofei','root','root');
$memcache_obj=memcache_connect('127.0.0.1',11211);
$arr=$memcache_obj->get('a');
//memcache_flush($memcache_obj);
//echo $arr;die;
if($arr=='')
{
    echo "没有缓存";
    $sql="select * from movie";
    $arr=$dbh->query($sql)->fetchAll(PDO::FETCH_ASSOC);
    $memcache_obj->set('a',$arr,0,60*80*80);
}
?>
<a href="noiseall.php">批量静态化</a>
<table border="1">
    <tr>
        <td>编号</td>
        <td>电影网址</td>
        <td>电影名称</td>
        <td>电影简介</td>
        <td>电影评分</td>
        <td>操作</td>
    </tr>
    <?php foreach($arr as $key=>$value){ ?>
        <tr>
            <td><?php echo $value['id']?></td>
            <td><?php echo $value['movie_url']?></td>
            <td><?php echo $value['movie_name']?></td>
            <td><?php echo $value['movie_jianjie']?></td>
            <td><?php echo $value['movie_score']?></td>
            <td>
                <a href="noise.php?id=<?php echo $value['id']?>">静态化</a>
            </td>
        </tr>
    <?php } ?>
</table>
